package com.lxw.study.behavioral.command.case2;

import java.util.List;

public class AllLightsOffCommand implements Command{
    private List<Light> lights;

    public AllLightsOffCommand(List<Light> lights) {
        this.lights = lights;
    }

    public void execute() {
        for (Light light : lights) {
            light.off();
        }
    }

    public void undo() {
        for (Light light : lights) {
            light.on();
        }
    }
}
